home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / distutils / tests / test_install.pyo (.txt) < prev   
Python Compiled Bytecode  |  2005-10-18  |  2KB  |  47 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. '''Tests for distutils.command.install.'''
  5. import os
  6. import unittest
  7. from distutils.command.install import install
  8. from distutils.core import Distribution
  9. from distutils.tests import support
  10.  
  11. class InstallTestCase(support.TempdirManager, unittest.TestCase):
  12.     
  13.     def test_home_installation_scheme(self):
  14.         builddir = self.mkdtemp()
  15.         destination = os.path.join(builddir, 'installation')
  16.         dist = Distribution({
  17.             'name': 'foopkg' })
  18.         dist.script_name = os.path.join(builddir, 'setup.py')
  19.         dist.command_obj['build'] = support.DummyCommand(build_base = builddir, build_lib = os.path.join(builddir, 'lib'))
  20.         cmd = install(dist)
  21.         cmd.home = destination
  22.         cmd.ensure_finalized()
  23.         self.assertEqual(cmd.install_base, destination)
  24.         self.assertEqual(cmd.install_platbase, destination)
  25.         
  26.         def check_path(got, expected):
  27.             got = os.path.normpath(got)
  28.             expected = os.path.normpath(expected)
  29.             self.assertEqual(got, expected)
  30.  
  31.         libdir = os.path.join(destination, 'lib', 'python')
  32.         check_path(cmd.install_lib, libdir)
  33.         check_path(cmd.install_platlib, libdir)
  34.         check_path(cmd.install_purelib, libdir)
  35.         check_path(cmd.install_headers, os.path.join(destination, 'include', 'python', 'foopkg'))
  36.         check_path(cmd.install_scripts, os.path.join(destination, 'bin'))
  37.         check_path(cmd.install_data, destination)
  38.  
  39.  
  40.  
  41. def test_suite():
  42.     return unittest.makeSuite(InstallTestCase)
  43.  
  44. if __name__ == '__main__':
  45.     unittest.main(defaultTest = 'test_suite')
  46.  
  47.